package com.travelSpring.mapper;

import com.travelSpring.entity.BaseEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface BaseEntityMapper {

    public List<BaseEntity> selectAll(BaseEntity user);

    public BaseEntity selectByName(String username);

    void insertBaseEntity(BaseEntity user);

    @Update("update user set username=#{username},name=#{name}," +
            "phone=#{phone},role=#{role},address=#{address}," +
            "email=#{email},examine=#{examine},avatar=#{avatar} where id=#{id}")
    void updateById(BaseEntity user);


    @Delete("delete from user where id=#{id}")
    void deleteById(Integer id);

    @Select("select * from user where id=#{id}")
    BaseEntity selectById(String userId);
}
